<script type="text/javascript">
	
	function batal(){
		document.location.href = '<?=base_url().'index.php/barang'?>';
	}
	
</script>

	<?php 
		if(validation_errors())
		{
	?>
			<ul class="message error grid_12">
				<li><?=validation_errors()?></li>
				<li class="close-bt"></li>
			</ul>	
	<?php
		} 
	?>

<section class="grid_12">
	<div class="block-border">
		<?php
			$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
			echo form_open('barang/insert', $attributes);
		?>
			<h1>Master > Master Keberangkatan : Qty > Tambah Data Keberangkatan</h1>
			
			<fieldset>
				<legend>Tambah Data Keberangkatan</legend>
				
				<div class="columns">
					<p class="colx2-left">
						<label for="complex-en-url">Nomor KA (*) :</label>
						<span class="relative">
							<input type="text" name="nomor_ka" id="nomor_ka" value="<?=set_value('nomor_ka')?>" class="setengah-width">
						</span>
					</p>
					<p class="colx2-left">
						<label for="complex-en-url">Nama KA (*) :</label>
						<span class="relative">
							<input type="text" name="nama_ka" id="nama_ka" value="<?=set_value('nama_ka')?>" class="setengah-width">
						</span>
					</p>
					<p class="colx2-left">
						<label for="complex-en-url">Relasi(*) :</label>
						<span class="relative">
							<input type="text" name="relasi" id="relasi" value="<?=set_value('relasi')?>" class="setengah-width">
						</span>
					</p>
					
					<p class="colx2-left">
						<label for="complex-en-url">Jam Kedatangan(*) :</label>
						<span class="relative">
							<select name="jam_kedatangan" id="jam_kedatangan"class="seperempat-width">
								<?php
									echo '<option value="Jam">Jam</option>';
										for($i=0;$i<24;$i++)
										{
											echo '<option value="'.$i.'">'.$i.'</option>';
										}
								?>
							</select>
							<select name="menit_kedatangan" id="menit_kedatangan"class="seperempat-width">
								<?php
									echo '<option value="Menit">Menit</option>';
										for($i=0;$i<60;$i++)
										{
											echo '<option value="'.$i.'">'.$i.'</option>';
										}
								?>
							</select>
						</span>
					</p>
					
					<p class="colx2-left">
						<label for="complex-en-url">Perkiraan Jam Datang(*) :</label>
						<span class="relative">
							
							<select name="perkiraan_jam_kedatangan" id="perkiraan_jam_kedatangan"class="seperempat-width">
								<?php
									echo '<option value="Jam">Jam</option>';
										for($i=0;$i<24;$i++)
										{
											echo '<option value="'.$i.'">'.$i.'</option>';
										}
								?>
							</select>
							<select name="perkiraan_menit_keberangkatan" id="perkiraan_menit_keberangkatan"class="seperempat-width">
								<?php
									echo '<option value="Menit">Menit</option>';
										for($i=0;$i<60;$i++)
										{
											echo '<option value="'.$i.'">'.$i.'</option>';
										}
								?>
							</select>
						</span>
					</p>
					
					<p class="colx2-left">
						<label for="complex-en-url">Status :</label>
						<span class="relative">
							<select name="id_status" id="id_status"class="seperempat-width">
								<?php
									$query = $this->db->get('status');
									if($query->num_rows() > 0)
									{
										foreach($query->result() as $row)
										{
											echo '<option value="'.$row->id.'">'.$row->keterangan.'</option>';
										}
									}
								?>
							</select>
						</span>
					</p>
				</div>
				
									
				<p><i> Field yang diberi tanda (*) harus di isi ! </i></p>
				
			</fieldset>
				
			<div id="tab-settings" class="tabs-content">
					<button type="submit"><img src="<?=base_url()?>asset/admin/images/icons/fugue/tick-circle.png" width="16" height="16"> Simpan</button>
					<button type="button" onclick="javascript:batal();" class="red">Batal</button> 			
			</div>
			
		</form>
	</div>
</section>